// dogBark.js
const Dog = require('./dog.js');

const taidi = new Dog('taidi', 5);
const zangao = new Dog('zangao', 9);

taidi.on('bark', function() {
    console.log(`${this.name} barked! energy: ${this.energy}`);
});

zangao.on('bark', function() {
    console.log(`${this.name} barked! energy: ${this.energy}`);
});